﻿using Heng.Elements.Core.Model.Repository.EF.Infrastructure.Repositories;
using Heng.Elements.ERD.Model.Entities;
using Heng.Elements.ERD.Model.Repositories;
using Heng.Elements.ERD.Model.Repository.EF.Contexts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Heng.Elements.ERD.Model.Repository.EF.Repositories
{
    public class DomainEntityAttributeRepository : EFEntityRepository<DomainEntityAttribute, CoreEntities>, IDomainEntityAttributeRepository
    {
        public IEnumerable<DomainEntityAttribute> GetByEntity(long entityId)
        {
            var attributes = from attr in this.ContextFacade.DbContext.DomainEntityAttributes
                             where attr.DomainEntity.Id == entityId && attr.Status == 0
                             select attr;

            return attributes.ToList();
        }
    }
}
